package tech.waterism.utils;


import tech.waterism.entity.FCurveHc;

import java.util.List;

public class ConvertZC {
    public static double getCfromZ(double z, List<FCurveHc> curveHc) {
        return MathFun.insert2(z, curveHc.stream().mapToDouble(FCurveHc::getZ).toArray(),
                curveHc.stream().mapToDouble(FCurveHc::getC).toArray(), curveHc.size());
    }

    public static double getZfromC(double c, List<FCurveHc> curveHc) {
        return MathFun.insert2(c, curveHc.stream().mapToDouble(FCurveHc::getC).toArray(),
                curveHc.stream().mapToDouble(FCurveHc::getZ).toArray(), curveHc.size());
    }
}
